<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "" "">
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:w="http://www.apusic.com/jsf/widget" xmlns:layout="http://www.apusic.com/jsf/layout"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:ajax="http://www.apusic.com/jsf/ajax"
	xmlns:c="http://java.sun.com/jstl/core" xmlns:om="http://www.apusic.com/jsf/misc"
	renderKitId="AJAX" xmlns:epm="http://www.bp.com.cn/epm">
	<w:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<w:stylesheet src="/css/kmp4.css" type="text/css"></w:stylesheet>
		<w:stylesheet src="/css/portlet.css" type="text/css"></w:stylesheet>
		<w:script src="/javascript/k4.js" type="text/javascript" language="UTF-8"></w:script>
		<om:useBean value="eop_welcomeBean"></om:useBean>
		<script>
		//<![CDATA[
		   //弹出会议记录窗口
		   function showMinutes(id){
		      showRepaireJsvar.addParam('id', id);
		      showRepaireJsvar.submit();
		   }
		   //修改会议记录窗口
		   function updateMinute(id){
		      updateMinJsvar.addParam('minId', id);
		      updateMinJsvar.submit();
		   }
		   
		   function checkMinContent(){
		     var con=minutesJsvar.getValue();
		     if(con==null||con==''){
		       alert('请输入内容');
		       return false;
		     }
		     return true;
		   }

			function enterIn(evt){
  				var evt=evt?evt:(window.event?window.event:null);//兼容IE和FF
			  if (evt.keyCode==13&&evt.ctrlKey){
 					 if(checkMinContent()){
 					 var minutesContent = minutesJsvar.getValue();
 					 var eventId=eventIdJsvar.getValue();
 					  saveTextRepaireJsvar.addParam('eventId', eventId);
 					 saveTextRepaireJsvar.addParam('minutesContent', minutesContent);
 					 saveTextRepaireJsvar.submit();
 					 }
				}
			}
			
		   
		   function showRepWindow(){
		      repaireWinJsvar.show();
		      clearMinuteContent();
		   }
		   function clearMinuteContent(){
		     minutesJsvar.setValue('');
		   }
		   
		   function showRoll(){
		     var eventId=eventIdJsvar.getValue();
		     //window.open('#{facesContext.externalContext.requestContextPath}/modules/eop/showMinutes.faces?eventId='+eventId, toolbar =no, menubar=no, scrollbars=no);
		     window.open ('#{facesContext.externalContext.requestContextPath}/modules/eop/showMinutes.faces?eventId='+eventId, '会议记录', 'toolbar=no, menubar=no, scrollbars=no, location=no, status=no,fullscreen=yes');
		   }
		   
		   function refDiv(){
		     var e=document.getElementById("minDiv")
            // e.scrollTop=e.scrollHeight;
           //alert(e.scrollHeight);
		   e.scrollTop = e.scrollHeight;
		   }
		//]]>
		</script>
	</w:head>
	<w:page title="最新事件">
		<layout:panelGrid columns="2" cellpadding="2" cellspacing="2" border="0" width="100%"
			styleClass="portlet" style="font-size: 12px;height: 400px">
			<layout:cell valign="top" style="width:33%;height: 400px;">
				<layout:panel border="false" header="true" title="应急事件" floatable="true"
					styleClass="k4-personal-panel" autoScroll="true" autoHeight="true">
					<w:toolBar>
						<w:button label="快速新建" id="createEvent" onclick="eventWinJsvar.show();" alwaysSubmit="false"
							image="#{facesContext.externalContext.requestContextPath}/images/add.gif" />
					</w:toolBar>
					<marquee style="height: 400px;" scrollamount="3" scrolldelay="100" valign="middle"
						behavior="scroll" direction="up" onmouseover="this.stop()" onmouseout="this.start()">
					<h:outputText id="eventName" escape="false"></h:outputText> </marquee>
				</layout:panel>
			</layout:cell>

		</layout:panelGrid>

		<!-- 快速新建 事件 -->
		<layout:window id="eventWin" jsvar="eventWinJsvar" title="新增事件" height="130" width="350">
			<layout:panel>
				<w:form>
					<w:toolBar>
						<w:button id="saveEvent" value="保存"
							image="#{facesContext.externalContext.requestContextPath}/images/save.gif"></w:button>
						<w:separator></w:separator>
						<w:button id="cancelEvent" value="取消"
							image="#{facesContext.externalContext.requestContextPath}/images/cancel.gif"
							onclick="eventWinJsvar.hide();" alwaysSubmit="false"></w:button>
					</w:toolBar>
					<layout:panelGrid cellpadding="0" cellspacing="0" border="1" styleClass="k4-form-grid"
						columns="2">
						<layout:cell styleClass="k4-form-fieldtitle">
							<h:outputLabel value="事件名称"></h:outputLabel>
						</layout:cell>
						<layout:cell styleClass="k4-form-fieldvalue">
							<w:textField id="eventTitle" styleClass="k4-form-textfield" required="true"
								requiredMessage="事件名称不能为空"></w:textField>
						</layout:cell>
					</layout:panelGrid>
				</w:form>
			</layout:panel>
		</layout:window>

		<!-- 会议记录 -->
		<layout:window id="repaireWin" jsvar="repaireWinJsvar" title="#{eop_welcomeBean.windowTitle}"
			height="455" width="543" modal="true">
			<w:form>
				<w:toolBar>
					<w:button label="弹出滚动栏" id="showRoll" onclick="showRoll();"
						image="#{facesContext.externalContext.requestContextPath}/images/add.gif" alwaysSubmit="false" />
				</w:toolBar>
				<layout:panelGrid style="width: 520px;height: 200px" columns="3">
					<h:outputText id="minutesList" escape="false"></h:outputText>
				</layout:panelGrid>

				<layout:panelGrid style="width: 520px;height: 150px" columns="3" onkeydown="enterIn(event);">
					<layout:cell styleClass="k4-form-fieldvalue">
					<!-- 	<w:simpleHtmlEditor height="150" width="520" id="minutesContent" jsvar="minutesJsvar"  onkeydown="enterIn(event);"
							fontFamilies="['宋体','隶书','楷体','仿宋','黑体','华文彩云','华文琥珀','幼圆','Times New Roman','微软雅黑','楷体_GB2312','仿宋_GB2312']" enableAlignments="false" enableColors="false" enableFontSize="false" enableFormat="false" enableLinks="false" enableLists="false" enableSourceEdit="false"></w:simpleHtmlEditor>
						 -->
						 <w:textArea width="520" height="150" style="font-size: 17;" id="minutesContent" jsvar="minutesJsvar">      
						               <f:validateLength minimum="1" maximum="200"/>   
						                     
					     </w:textArea>
					</layout:cell>
					<layout:cell style="display: none">
						<w:textField id="eventId" jsvar="eventIdJsvar"></w:textField>
					</layout:cell>
				</layout:panelGrid>
				<w:toolBar>
					<w:button id="cancelRepair" value="关闭"
						image="#{facesContext.externalContext.requestContextPath}/images/cancel.gif"
						onclick="repaireWinJsvar.hide();" alwaysSubmit="false"></w:button>
					<w:separator></w:separator>
					<w:button id="saveRepair" value="发送"
						image="#{facesContext.externalContext.requestContextPath}/images/save.gif"
						onclick="return checkMinContent();">
						<ajax:linkedUpdate target="minutesList"></ajax:linkedUpdate>
					</w:button>
				</w:toolBar>
			</w:form>
		</layout:window>
		<ajax:submitAction id="showRepaire" jsvar="showRepaireJsvar"></ajax:submitAction>
		<ajax:submitAction id="saveTextRepaire" jsvar="saveTextRepaireJsvar"></ajax:submitAction>


		<!-- 修改会议记录-->
		<layout:window id="updateMinWin" jsvar="updateMinWinJsvar" title="修改会议记录" height="240" width="555"
			modal="true">
			<layout:panel>
				<w:form>
					<w:toolBar>
						<w:button id="updateMinuate" value="保存"
							image="#{facesContext.externalContext.requestContextPath}/images/save.gif">
							<ajax:linkedUpdate target="minutesList"></ajax:linkedUpdate>
						</w:button>
						<w:separator></w:separator>
						<w:button id="cancelUpdateMin" value="取消"
							image="#{facesContext.externalContext.requestContextPath}/images/cancel.gif"
							onclick="updateMinWinJsvar.hide();" alwaysSubmit="false"></w:button>
					</w:toolBar>
					<layout:panelGrid cellpadding="0" cellspacing="0" border="1" styleClass="k4-form-grid"
						columns="2">
						<layout:cell styleClass="k4-form-fieldvalue" colspan="2">
							<w:simpleHtmlEditor height="150" width="520" id="uMinCon" jsvar="uMinConJsvar" onkeydown="enterIn(event);"
								fontFamilies="['宋体','隶书','楷体','仿宋','黑体','华文彩云','华文琥珀','幼圆','Times New Roman','微软雅黑','楷体_GB2312','仿宋_GB2312']" enableFontSize="false" enableLinks="false" enableLists="false" enableSourceEdit="false" enableFormat="false" enableColors="false" enableAlignments="false"></w:simpleHtmlEditor>
						</layout:cell>
						<layout:cell style="display: none">
							<w:textField id="minId" jsvar="minIdJsvar"></w:textField>
						</layout:cell>
					</layout:panelGrid>
				</w:form>
			</layout:panel>
		</layout:window>

		<ajax:submitAction id="showUpdateMin" jsvar="updateMinJsvar"></ajax:submitAction>
	</w:page>
</f:view>